<%@ Control Language="C#" AutoEventWireup="true" Codebehind="WeaponTop25.ascx.cs"
    Inherits="ASP_TF2LogParser.UserControls.WeaponTop25" %>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" AllowSorting="True">
    <Columns>
        <asp:TemplateField HeaderText="Weapon" SortExpression="WeaponFullName">
            <ItemTemplate>
                <asp:Label runat="server" Text='<%# GenerateUrl( Eval("PlayerName").ToString(), Eval("PlayerId").ToString() ) %>'
                    ID="WeaponLabel"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Kills" HeaderText="Kills" SortExpression="Kills" />
        <asp:BoundField DataField="Deaths" HeaderText="Deaths" SortExpression="Deaths" />
        <asp:TemplateField HeaderText="K:D" SortExpression="KillDeathRatio">
            <ItemTemplate>
                <asp:Label runat="server" Text='<%# GetKillDeathRatio( Convert.ToInt32(Eval("Kills").ToString()), Convert.ToInt32(Eval("Deaths").ToString()) ) %>'
                    ID="KillDeathRatioLabel"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Headshot %" SortExpression="HeadShotPercentage">
            <ItemTemplate>
                <asp:Label runat="server" Text='<%# GetHeadshotPercentage( Eval("Kills").ToString(), Eval("PlayerId").ToString() ) %>'
                    ID="HeadshotPercentageLabel"></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="GetWeaponTop25Stats" TypeName="LogParser.DA.WeaponModel">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="-1" Name="WeaponId" QueryStringField="weaponId"
            Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
